﻿Imports System.Windows.Data

Public Class InverseBooleanConverter
    Implements IValueConverter

#Region "IValueConverter Memebers"
    Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements IValueConverter.Convert
        If (targetType <> GetType(Boolean)) Then Throw New InvalidOperationException("The target must be a boolean")
        Return Not (CType(value, Boolean))
    End Function

    Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
        Throw New NotSupportedException()
    End Function
#End Region

End Class